<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>libnetconf: ncds_custom_funcs Struct Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../libnetconf-logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">libnetconf
   &#160;<span id="projectnumber">0.10.0-146_trunk</span>
   </div>
   <div id="projectbrief">NETCONF Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="../../modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="../../annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="../../classes.html"><span>Data&#160;Structure&#160;Index</span></a></li>
      <li><a href="../../functions.html"><span>Data&#160;Fields</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d0/d28/structncds__custom__funcs.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-attribs">Data Fields</a>  </div>
  <div class="headertitle">
<div class="title">ncds_custom_funcs Struct Reference<div class="ingroups"><a class="el" href="../../da/d64/group__customds.html">Custom Datastore</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Public callbacks for the data store.  
 <a href="../../d0/d28/structncds__custom__funcs.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="../../d0/d63/datastore__custom_8h_source.html">datastore_custom.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:ae0d54e97fa9abaafbf3b234c365a09b6"><td class="memItemLeft" align="right" valign="top">int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d28/structncds__custom__funcs.html#ae0d54e97fa9abaafbf3b234c365a09b6">copyconfig</a> )(void *data, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> target, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> source, char *config, struct nc_err **error)</td></tr>
<tr class="memdesc:ae0d54e97fa9abaafbf3b234c365a09b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy config from one data store to another.  <a href="#ae0d54e97fa9abaafbf3b234c365a09b6">More...</a><br/></td></tr>
<tr class="separator:ae0d54e97fa9abaafbf3b234c365a09b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6318498a2d647313bf272303228ee4dc"><td class="memItemLeft" align="right" valign="top">int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d28/structncds__custom__funcs.html#a6318498a2d647313bf272303228ee4dc">deleteconfig</a> )(void *data, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> target, struct nc_err **error)</td></tr>
<tr class="memdesc:a6318498a2d647313bf272303228ee4dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Make the given data source empty.  <a href="#a6318498a2d647313bf272303228ee4dc">More...</a><br/></td></tr>
<tr class="separator:a6318498a2d647313bf272303228ee4dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a218bd52cfd25ead58364f2d058dd737f"><td class="memItemLeft" align="right" valign="top">int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d28/structncds__custom__funcs.html#a218bd52cfd25ead58364f2d058dd737f">editconfig</a> )(void *data, const <a class="el" href="../../db/de9/group__rpc.html#gab21d1d39737065c552f2ccc5b4819262">nc_rpc</a> *rpc, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> target, const char *config, <a class="el" href="../../db/de9/group__rpc.html#ga5852fd110198481afb37cc8dcf0bf454">NC_EDIT_DEFOP_TYPE</a> defop, <a class="el" href="../../db/de9/group__rpc.html#ga8eb32ba579043f2750fa8558d9284b32">NC_EDIT_ERROPT_TYPE</a> errop, struct nc_err **error)</td></tr>
<tr class="memdesc:a218bd52cfd25ead58364f2d058dd737f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Perform the editconfig operation.  <a href="#a218bd52cfd25ead58364f2d058dd737f">More...</a><br/></td></tr>
<tr class="separator:a218bd52cfd25ead58364f2d058dd737f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af147a5b35325a0d302af2d813e60df06"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d28/structncds__custom__funcs.html#af147a5b35325a0d302af2d813e60df06">free</a> )(void *data)</td></tr>
<tr class="memdesc:af147a5b35325a0d302af2d813e60df06"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called after the last use of the data store.  <a href="#af147a5b35325a0d302af2d813e60df06">More...</a><br/></td></tr>
<tr class="separator:af147a5b35325a0d302af2d813e60df06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e5c2e2b2abdd48a249f02526e04ceca"><td class="memItemLeft" align="right" valign="top">char *(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d28/structncds__custom__funcs.html#a7e5c2e2b2abdd48a249f02526e04ceca">getconfig</a> )(void *data, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> target, struct nc_err **error)</td></tr>
<tr class="memdesc:a7e5c2e2b2abdd48a249f02526e04ceca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get content of the config.  <a href="#a7e5c2e2b2abdd48a249f02526e04ceca">More...</a><br/></td></tr>
<tr class="separator:a7e5c2e2b2abdd48a249f02526e04ceca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8da4627756e752c849c155ed1c7a09db"><td class="memItemLeft" align="right" valign="top">int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d28/structncds__custom__funcs.html#a8da4627756e752c849c155ed1c7a09db">init</a> )(void *data)</td></tr>
<tr class="memdesc:a8da4627756e752c849c155ed1c7a09db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called before the data store is used.  <a href="#a8da4627756e752c849c155ed1c7a09db">More...</a><br/></td></tr>
<tr class="separator:a8da4627756e752c849c155ed1c7a09db"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae03c8955608bc2c438d9804d18f340b8"><td class="memItemLeft" align="right" valign="top">int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d28/structncds__custom__funcs.html#ae03c8955608bc2c438d9804d18f340b8">is_locked</a> )(void *data, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> target, const char **session_id, const char **datetime)</td></tr>
<tr class="memdesc:ae03c8955608bc2c438d9804d18f340b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Is datastore currently locked?  <a href="#ae03c8955608bc2c438d9804d18f340b8">More...</a><br/></td></tr>
<tr class="separator:ae03c8955608bc2c438d9804d18f340b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad4ec2f4e544216398bf5b56a383a4dfa"><td class="memItemLeft" align="right" valign="top">int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d28/structncds__custom__funcs.html#ad4ec2f4e544216398bf5b56a383a4dfa">lock</a> )(void *data, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> target, const char *session_id, struct nc_err **error)</td></tr>
<tr class="memdesc:ad4ec2f4e544216398bf5b56a383a4dfa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Lock the data store from other processes.  <a href="#ad4ec2f4e544216398bf5b56a383a4dfa">More...</a><br/></td></tr>
<tr class="separator:ad4ec2f4e544216398bf5b56a383a4dfa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f69235dfc5cd8714c45690fff0abdc5"><td class="memItemLeft" align="right" valign="top">int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d28/structncds__custom__funcs.html#a1f69235dfc5cd8714c45690fff0abdc5">rollback</a> )(void *data)</td></tr>
<tr class="memdesc:a1f69235dfc5cd8714c45690fff0abdc5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Revert the last change.  <a href="#a1f69235dfc5cd8714c45690fff0abdc5">More...</a><br/></td></tr>
<tr class="separator:a1f69235dfc5cd8714c45690fff0abdc5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5bb396eac30e2f060592465f1b8cb2a9"><td class="memItemLeft" align="right" valign="top">int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d28/structncds__custom__funcs.html#a5bb396eac30e2f060592465f1b8cb2a9">unlock</a> )(void *data, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> target, const char *session_id, struct nc_err **error)</td></tr>
<tr class="memdesc:a5bb396eac30e2f060592465f1b8cb2a9"><td class="mdescLeft">&#160;</td><td class="mdescRight">The counter-part of lock.  <a href="#a5bb396eac30e2f060592465f1b8cb2a9">More...</a><br/></td></tr>
<tr class="separator:a5bb396eac30e2f060592465f1b8cb2a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a793b5d1b168db7d9529cbc6d02e614b1"><td class="memItemLeft" align="right" valign="top">int(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d0/d28/structncds__custom__funcs.html#a793b5d1b168db7d9529cbc6d02e614b1">was_changed</a> )(void *data)</td></tr>
<tr class="memdesc:a793b5d1b168db7d9529cbc6d02e614b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Was the content of data store changed?  <a href="#a793b5d1b168db7d9529cbc6d02e614b1">More...</a><br/></td></tr>
<tr class="separator:a793b5d1b168db7d9529cbc6d02e614b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Public callbacks for the data store. </p>
<p>These are the callbacks that need to be provided by the server to be used from the custom data store. </p>
</div><h2 class="groupheader">Field Documentation</h2>
<a class="anchor" id="ae0d54e97fa9abaafbf3b234c365a09b6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(* copyconfig)(void *data, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> target, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> source, char *config, struct nc_err **error)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Copy config from one data store to another. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The user data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">target</td><td>Where to copy. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">source</td><td>From where to copy. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">config</td><td>Custom data if source parameter is NC_DATASTORE_CONFIG </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">error</td><td>Set this in case of EXIT_FAILURE, to indicate what went wrong. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>EXIT_SUCCESS or EXIT_FAILURE. </dd></dl>

</div>
</div>
<a class="anchor" id="a6318498a2d647313bf272303228ee4dc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(* deleteconfig)(void *data, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> target, struct nc_err **error)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Make the given data source empty. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The user data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">target</td><td>Which part (running, startup, candidate) is supposed to be cleaned out. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">error</td><td>Set this in case of EXIT_FAILURE, to indicate what went wrong. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>EXIT_SUCCESS or EXIT_FAILURE. </dd></dl>

</div>
</div>
<a class="anchor" id="a218bd52cfd25ead58364f2d058dd737f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(* editconfig)(void *data, const <a class="el" href="../../db/de9/group__rpc.html#gab21d1d39737065c552f2ccc5b4819262">nc_rpc</a> *rpc, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> target, const char *config, <a class="el" href="../../db/de9/group__rpc.html#ga5852fd110198481afb37cc8dcf0bf454">NC_EDIT_DEFOP_TYPE</a> defop, <a class="el" href="../../db/de9/group__rpc.html#ga8eb32ba579043f2750fa8558d9284b32">NC_EDIT_ERROPT_TYPE</a> errop, struct nc_err **error)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Perform the editconfig operation. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The user data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">rpc</td><td>RPC message with the request. RPC message is used only for access control. If rpc is NULL access control is skipped. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">target</td><td>What datastore part is going to be modified. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">config</td><td>Edit configuration data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">defop</td><td>Default edit operation. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">errop</td><td>Error-option. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">error</td><td>Set this in case of EXIT_FAILURE, to indicate what went wrong. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>EXIT_SUCCESS or EXIT_FAILURE. </dd></dl>

</div>
</div>
<a class="anchor" id="af147a5b35325a0d302af2d813e60df06"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* free)(void *data)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Called after the last use of the data store. </p>
<p>This is called after the library stops using the data store. Use this place to free whatever resources (including data, if it was allocated.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The user data. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a7e5c2e2b2abdd48a249f02526e04ceca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char*(* getconfig)(void *data, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> target, struct nc_err **error)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get content of the config. </p>
<p>The ownership of the returned string is passed onto the caller. So, allocate it and forget.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The user data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">target</td><td>Where to read data from. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">error</td><td>Set this in case of error, to indicate what went wrong. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Serialized content of the datastore, NULL on error </dd></dl>

</div>
</div>
<a class="anchor" id="a8da4627756e752c849c155ed1c7a09db"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(* init)(void *data)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Called before the data store is used. </p>
<p>This callback is called before the data store is used (but after the data has been set).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The user data. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 for success, 1 for failure. </dd></dl>

</div>
</div>
<a class="anchor" id="ae03c8955608bc2c438d9804d18f340b8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(* is_locked)(void *data, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> target, const char **session_id, const char **datetime)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Is datastore currently locked? </p>
<p>If function is not implemented, libnetconf will use internal information about the lock. Note, that this information is process specific. If your server runs in multiple processes, libnetconf's information might not be valid. In such a case you should properly implement this function to share lock information.</p>
<p>Note, that session_id and datetime can be NULL when caller does not need this information.</p>
<p>To announce, that this function is not implemented, set it to NULL in callbacks parameter passed to the <a class="el" href="../../da/d64/group__customds.html#ga1e9518d8cc9023c7585fd4de15daa75b" title="Set custom data stored in custom datastore. ">ncds_custom_set_data()</a> function.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The user data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">target</td><td>Which datastore lock information is required. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">session_id</td><td>Which session has locked the datastore. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">datatime</td><td>When the datastore was locked (RFC 3339 format) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>0 datastore is not locked</li>
<li>1 datastore is locked</li>
<li>negative value - error </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="ad4ec2f4e544216398bf5b56a383a4dfa"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(* lock)(void *data, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> target, const char *session_id, struct nc_err **error)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Lock the data store from other processes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The user data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">target</td><td>Which data store should be locked. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">session_id</td><td>ID of the session requesting the lock. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">error</td><td>Set this in case of EXIT_FAILURE, to indicate what went wrong. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>EXIT_SUCCESS or EXIT_FAILURE. </dd></dl>

</div>
</div>
<a class="anchor" id="a1f69235dfc5cd8714c45690fff0abdc5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(* rollback)(void *data)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Revert the last change. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The user data. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 for success, 1 for error. </dd></dl>

</div>
</div>
<a class="anchor" id="a5bb396eac30e2f060592465f1b8cb2a9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(* unlock)(void *data, <a class="el" href="../../db/d67/group__store.html#ga5e4b9ee138b963e8ea2354fef2ebbe73">NC_DATASTORE</a> target, const char *session_id, struct nc_err **error)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The counter-part of lock. </p>
<p>Function must check that the datastore was locked by the same session (according to the provided session_id) that is now requesting its unlock.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The user data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">target</td><td>Which data store should be unlocked. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">session_id</td><td>ID of the session requesting the unlock. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">error</td><td>Set this in case of EXIT_FAILURE, to indicate what went wrong. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>EXIT_SUCCESS or EXIT_FAILURE. </dd></dl>

</div>
</div>
<a class="anchor" id="a793b5d1b168db7d9529cbc6d02e614b1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(* was_changed)(void *data)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Was the content of data store changed? </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>The user data. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if content not changed, non-zero else </dd></dl>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li>src/datastore/custom/<a class="el" href="../../d0/d63/datastore__custom_8h_source.html">datastore_custom.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../d0/d28/structncds__custom__funcs.html">ncds_custom_funcs</a></li>
    <li class="footer">Generated on Fri Apr 15 2016 09:20:09 for libnetconf by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
